<%@ taglib prefix="s" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<meta name="decorator" content="default"/>
<script>
    function loadFormData(patId,name,sex,age,chargeType,identity,idNo,unitInContract){
       parent.assignment(patId,name,sex,age,chargeType,identity,idNo,unitInContract);
    }
</script>
<div class="content-wrap" id="mainCenterDiv">
    <div class="wrapper" style="bottom: 50px;">
        <section class="panel panel-default">
            <div class="panel-body">
                <div class="table-responsive no-border">
                    <div class="datatable-top">
                        <div class="pull-left">
                            <form:form id="searchForm"  modelAttribute="patMasterIndex" onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/oper/patMasterIndex/retrievePatMaster');" method="post" class="form-inline">
                                &nbsp;&nbsp;<label>姓名 ：</label><form:input path="name" maxlength="50" class="form-control" ></form:input>
                                &nbsp;&nbsp;<label>出生日期：</label><form:input path="birthdayDate"  class="form-control Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"></form:input>
                                &nbsp;&nbsp;<label>电话:</label><form:input path="phone" class="form-control"></form:input>
                                &nbsp;&nbsp;<label>身份证：</label><form:input path="idNo" class="form-control"></form:input>
                                <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                            </form:form>
                        </div>
                    </div>
                    <table id="contentTable" class="table table-bordered mg-t datatable" style="width: 70%">
                        <thead>
                        <tr>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>年龄</th>
                            <th>电话</th>
                            <th>身份证号</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${page.list}" var="pat">
                        <tr onclick="loadFormData('${pat.id}','${pat.name}','${pat.sex}','${pat.age}','${pat.chargeType}','${pat.identity}','${pat.idNo}','${pat.unitInContract}')">
                            <td> ${pat.name}</td>
                            <td> ${fns:getDictLabel(pat.sex, 'SEX_DICT', '')}</td>
                            <td> ${pat.age}</td>
                            <td> ${pat.phone}</td>
                            <td> ${pat.idNo}</td>
                        </tr>
                        </c:forEach>
                    </table>
                    <div class="pagination">${page}</div>
                </div>
            </div>
        </section>
    </div>
</div>
